# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=kmailtransport
pkgver=23.08.4
pkgrel=0
pkgdesc="Manage mail transport"
# armhf blocked by extra-cmake-modules
# ppc64le and s390x blocked by libkgapi
arch="all !armhf !ppc64le !s390x !riscv64"
url="https://kontact.kde.org/"
license="LGPL-2.0-or-later"
depends_dev="
	akonadi-dev
	akonadi-mime-dev
	kcmutils5-dev
	kconfigwidgets5-dev
	ki18n5-dev
	kio5-dev
	kmime-dev
	ksmtp-dev
	kwallet5-dev
	libkgapi-dev
	qtkeychain-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	samurai
	"
checkdepends="xvfb-run"
_repo_url="https://invent.kde.org/pim/kmailtransport.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/kmailtransport-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-lang"
options="!check" # Requires OpenGL and running dbus

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	xvfb-run ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
caf66701021aad2cc7c83dc4b171d5868bc6f28f51c6756bc1c5658d8ee5db040a7514d33b79e491ad328b43a75b291c15252072d194b54c363f68371749c2d3  kmailtransport-23.08.4.tar.xz
"
